package com.xr.miniprogram.controller.test;

import com.alibaba.fastjson.JSON;
import com.xr.common.config.WXPayConfig;
import com.xr.common.core.controller.BaseController;
import com.xr.common.core.domain.AjaxResult;
import com.xr.miniprogram.domain.MiniProgramComment;
import com.xr.miniprogram.domain.vo.StandardsInputForm;
import io.swagger.annotations.Api;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;

/**
 * description:
 *
 * @author: wls
 * @date: 2023/9/4 9:56
 * @version:1.0
 */
@Api("测试控制器")
@RestController
@RequestMapping("/test/api")
public class MiniProgramTestController extends BaseController {

    @Resource
    private WXPayConfig wxPayConfig;

    @GetMapping("/getWxPayConfig")
    public AjaxResult getWxPayConfig(){
        String appId = wxPayConfig.getAppId();
        return success(appId);
    }

    public static void main(String[] args) {
        List<StandardsInputForm> list = new ArrayList<>();
        list.add(new StandardsInputForm("房屋面积",new BigDecimal(11),"平米",252L,155L, 1L));
        System.out.println(JSON.toJSONString(list));
        System.out.println(JSON.parse(JSON.toJSONString(list)));
    }

}
